Field of the Invention
The present invention relates to a motor drive device for driving a feed shaft or spindle of a machine tool or an arm of an industrial machine or an industrial robot etc. wherein the motor drive device is provided with the function of changing a mode of current detection of current flowing through the motor.
Description of the Related Art
In a general motor drive device of a motor used in a machine tool, industrial machine, or industrial robot, the current flowing through the motor is detected by a current detecting part and information on the current is informed to a current control part controlling the current. The current detecting part of a motor drive device is comprised of a current detection device on a main circuit and an A/D converter converting an analog signal detected by the current detection device to a digital signal. The current control part converts the information on the current detected by the current detecting part (analog signal) from an analog to digital format by the A/D converter and uses the converted digital signal to control the current flowing through the motor.
At this time, it is possible to improve the precision of detection of the current flowing through the motor and reduce the error between the actual current and the detected current so as to control the current more accurately. Inside the current detecting part, in the same way as a general electrical circuit, a filter is provided for the purpose of reducing noise riding on a signal line. As such a filter, a motor control device using a decimation filter is disclosed in Japanese Patent Publication No. 2013-198229A.
However, when using a filter designed to reduce noise riding on a signal line inside a current detecting part, in the process of converting a signal from an analog to digital format through the filter after detecting the current flowing through the motor at the current detection device, a time delay occurs between the current information from the current detecting part when reaching the current control part and the actual current. Further, when a small inductance motor is connected to the motor drive device and the slope of increase or decrease of the current becomes greater, the delay causes a discrepancy between the actual current and detected current and the precision of current detection is sometimes lowered.